# -*- coding: utf-8 -*-
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  #protect_from_forgery # See ActionController::RequestForgeryProtection for details

  # Scrub sensitive parameters from your log
  # filter_parameter_logging :password
  def user_authorize
    if !session[:user_id]# or session[:client_ip] != request.env['HTTP_X_FORWARDED_FOR']
      reset_session
      #flash[:notice] = _('Please login or register first.')
      redirect_to(:controller => "fee", :action => "login") and return
    end
  end

  def sys_before_log
    logger.info "-------------------"+params[:controller]+","+params[:action] +","+request.method+"-------------------From sys_before_log Begin"
    #logger.info params
    logger.info request.query_string    
  end

  def sys_after_log
    logger.info "-------------------"+params[:controller]+","+params[:action]+"-------------------From sys_before_log End"
  end
end
